<?php


namespace App\Http\Controllers\Wx;


use App\CodeResponse;
use App\Http\Controllers\Controller;

class WxController extends Controller
{
    protected function returnCode(array $codeResponse,$data = [])
    {
        list($code,$msg) = $codeResponse;
        return response()->json(['errno' => $code,'errmsg' => $msg,'data' => $data]);
    }

    protected function success($data)
    {
        return $this->returnCode(CodeResponse::SUCCESS,$data);
    }

    protected function fail(array $codeResponse)
    {
        return $this->returnCode($codeResponse);
    }
}
